(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/shopListView.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, 'ed6a2LK6A9L/JM+lE09FO6c', 'shopListView', __filename);
// Script/shopListView.js

'use strict';

var _XmlHttpTool = require('./XmlHttpTool');

var _XmlHttpTool2 = _interopRequireDefault(_XmlHttpTool);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var shopItem = cc.Class({
    name: 'shopItem',
    properties: {

        shopImageUrl: cc.String,
        shopName: cc.String,
        shopStatus: cc.Integer,
        chargeBtn: cc.Node,
        shopStar: cc.String
    }
});

cc.Class({
    extends: cc.Component,

    properties: {

        items: {
            default: [],
            type: shopItem
        }, //代码几个item格子 初始化
        closeShopBtn: cc.Node,
        scrollShopScrollView: cc.Node,
        itemPrefab: cc.Prefab, //预制节点 代表cell内容详情
        markView: cc.Node
    },

    onLoad: function onLoad() {

        //    for (var i = 0; i < this.items.length; ++i) {

        //     var item = cc.instantiate(this.itemPrefab);
        //     this.node.addChild(item);
        //     item.getComponent('goodItems').init("1");

        // }

        this.markView.on('touchstart', function (event) {
            console.log("点击结算背景层");
        }, this);

        var that = this;
        _XmlHttpTool2.default.NhttpPost("/marmot/prize_list", {}, function (res) {

            that.items = res;
            for (var i = 0; i < that.items.length; ++i) {

                var item = cc.instantiate(that.itemPrefab);
                that.node.addChild(item);
                item.getComponent('goodItems').init(that.items[i]);
            }
        }, function (failres) {

            console.log("星币商城请求错误", failres);
        });
    },


    closeShopClick: function closeShopClick() {

        console.log("关闭购物车");
        this.scrollShopScrollView.active = false;
    },

    start: function start() {}
}

// update (dt) {},
);

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=shopListView.js.map
        